package com.siruier.boss.ui.activity.commom

import android.content.Intent
import android.view.View
import com.siruier.boss.databinding.ActivitySignatureBinding
import com.siruier.boss.ui.base.BaseActivity
import com.siruier.boss.ui.utils.Utils
import me.jessyan.autosize.internal.CancelAdapt

class SignatureActivity : BaseActivity<ActivitySignatureBinding>(), CancelAdapt {
    override fun initView() {
        Utils.invasionStatusBar(this)
        bindViewClick(vb.buttonConfirm, vb.buttonClear)
    }

    override fun onClick(v: View?) {
        when (v) {
            vb.buttonConfirm -> {
                setResult(RESULT_OK, Intent().apply {
                    putExtra("signatureFile", vb.signature.file)
                })
                finish()
            }
            vb.buttonClear -> {
                vb.signature.clear()
            }
        }
    }
}